package org.shop.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.shop.dao.JoinInfoMapper;
import org.shop.entity.JoinInfo;
import org.shop.service.JoinInfoService;
import org.shop.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class JoinInfoServiceImpl extends BaseServiceImpl<JoinInfo, Long> implements JoinInfoService{

	@Autowired
	private JoinInfoMapper joinInfoMapper;
	
	@Override
	public List<JoinInfo> getJoinInfoByActivityID(Long activityId) {
		return joinInfoMapper.getJoinInfoByActivityID(activityId);
	}
	
	@Override
	public int getJoinCount(Map<String, Object> params) {
		return joinInfoMapper.getJoinCount(params);
	}

	@Override
	public Map<String, Object> getJoinInfoList(Map<String, Object> paramMap) {
		List<Map<String, Object>> allJoinInfoList = joinInfoMapper.getJoinInfoList(paramMap);
        Integer count = joinInfoMapper.getJoinInfoCount(paramMap);
        //分页数据
        Map<String, Object> dataMap = new HashMap<String, Object>();
        dataMap.put("total", count);
        dataMap.put("rows", allJoinInfoList);
        return dataMap;
	}

	@Override
	public int delJoinInfo(Long activityId) {
		return joinInfoMapper.delJoinInfo(activityId);
	}

	@Override
	public int ifJoinInfo(Map<String, Object> params) {
		return joinInfoMapper.ifJoinInfo(params);
	}
   
}